home *** CD-ROM | disk | FTP | other *** search
PiXCL source | 1996-08-14 | 3.1 KB | 129 lines |
- Initialize:
- SetColorPalette(GENERATE)
- WinGetActive(Win$)
- UseCoordinates(PIXEL)
- UseBackGround(TRANSPARENT,192,192,192)
- DrawBackGround
- SetMouse(0,0,300,200,Test,X,Y)
- WaitInput(100) {let NT and 95 catch up}
- WinLocate(Win$,100,100,520,360,Res)
- Title$ = "Slot Machine Example"
- WinTitle(Win$, Title$)
-
-
- InfoMenu(REMOVE)
- WaitInput(100)
- SetMenu("Exit!",Leave,
- ENDPOPUP,
- "Play",Test,
- ENDPOPUP)
-
- Button(100,150,200,180,"Play",Test)
- WinGetClientRect("",cx1,cy1,cx2,cy2)
- DrawShadeRectangle(cx1,cy1,cx2,cy2, 0,0,0, 0,0,255, TOPBOTTOM)
- GoSub DrawSlotWindows
-
- Wait_for_Input:
- WaitInput()
-
-
- Leave:
- End
-
- Test:
- GoSub DrawSlotWindows
- SpinNumber = 5
- Random(14,Result)
- ix1 = 20 ix2 = 10
- While SpinNumber <> 0
- GoSub Spin
- SpinNumber--
- EndWhile
- GoSub StopSpin
- WaitInput(100)
-
- SpinNumber = 5
- Random(14,Result)
- ix1 = 120 ix2 = 10
- While SpinNumber <> 0
- GoSub Spin
- SpinNumber--
- EndWhile
- GoSub StopSpin
- WaitInput(100)
-
- SpinNumber = 5
- Random(14,Result)
- ix1 = 220 ix2 = 10
- While SpinNumber <> 0
- GoSub Spin
- SpinNumber--
- EndWhile
- GoSub StopSpin
- WaitInput(100)
-
- SpinNumber = 5
- Random(14,Result)
- ix1 = 320 ix2 = 10
- While SpinNumber <> 0
- GoSub Spin
- SpinNumber--
- EndWhile
- GoSub StopSpin
-
-
-
- Goto Wait_for_Input
-
- {======================================================================}
- Spin:
- DrawIcon(ix1,ix2,64,64,ICON01)
- DrawIcon(ix1,ix2,64,64,ICON02)
- DrawIcon(ix1,ix2,64,64,ICON03)
- DrawIcon(ix1,ix2,64,64,ICON04)
- DrawIcon(ix1,ix2,64,64,ICON05)
- DrawIcon(ix1,ix2,64,64,ICON06)
- DrawIcon(ix1,ix2,64,64,ICON07)
- DrawIcon(ix1,ix2,64,64,ICON08)
- DrawIcon(ix1,ix2,64,64,ICON09)
- DrawIcon(ix1,ix2,64,64,ICON10)
- DrawIcon(ix1,ix2,64,64,ICON11)
- DrawIcon(ix1,ix2,64,64,ICON12)
- DrawIcon(ix1,ix2,64,64,ICON13)
- DrawIcon(ix1,ix2,64,64,ICON14)
- Return
-
- StopSpin:
- If Result = 1 Then DrawIcon(ix1,ix2,64,64,ICON01)
- If Result = 2 Then DrawIcon(ix1,ix2,64,64,ICON02)
- If Result = 3 Then DrawIcon(ix1,ix2,64,64,ICON03)
- If Result = 4 Then DrawIcon(ix1,ix2,64,64,ICON04)
- If Result = 5 Then DrawIcon(ix1,ix2,64,64,ICON05)
- If Result = 6 Then DrawIcon(ix1,ix2,64,64,ICON06)
- If Result = 7 Then DrawIcon(ix1,ix2,64,64,ICON07)
- If Result = 8 Then DrawIcon(ix1,ix2,64,64,ICON08)
- If Result = 9 Then DrawIcon(ix1,ix2,64,64,ICON09)
- If Result = 10 Then DrawIcon(ix1,ix2,64,64,ICON10)
- If Result = 11 Then DrawIcon(ix1,ix2,64,64,ICON11)
- If Result = 12 Then DrawIcon(ix1,ix2,64,64,ICON12)
- If Result = 13 Then DrawIcon(ix1,ix2,64,64,ICON13)
- If Result = 14 Then DrawIcon(ix1,ix2,64,64,ICON14)
- Return
-
-
- DrawSlotWindows:
- UsePen(SOLID,1,0,255,255)
- UseBrush(SOLID,255,255,255)
- DrawRectangle( 20,10, 84,74)
- DrawRectangle(120,10,184,74)
- DrawRectangle(220,10,284,74)
- DrawRectangle(320,10,384,74)
-
- UseFont("Arial",7,15,NOBOLD,NOITALIC,NOUNDERLINE,255,255,255)
- DrawText(20,90,"Odds of all the same icons are 38,416 : 1")
- DrawText(20,105,"Odds of three icons the same are 2,955 : 1")
- DrawText(20,120,"Odds of two icons the same are 227 : 1")
-
- Return
-
-